package com.tensquare.article.client;
/*
 *ClassName:UserClient
 *Description:获取文章对应的用户信息
 *@author:可爱的大鸭子
 */

import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value="tensquare-user")
public interface UserClient {
    //根据用户id查询用户信息
    @RequestMapping(value="/user/{id}",method = RequestMethod.GET)
    public Result findById(@PathVariable("id") String id);
    /**
     * 增加粉丝数
     * @param userid
     * @param x
     */
    @RequestMapping(value="/user/incfans/{userid}/{x}",method= RequestMethod.POST)
    //@PathVariable注解一定要指定参数名称，否则出错
    public void incFanscount(@PathVariable("userid") String userid,@PathVariable("x") int x);
    /**
     * 增加关注数
     * @param userid
     * @param x
     */
    @RequestMapping(value="/user/incfollow/{userid}/{x}",method=
            RequestMethod.POST)
    public void incFollowcount(@PathVariable("userid") String userid,@PathVariable("x") int x);
}
